class Stock < ActiveRecord::Base
  attr_accessible :product_id, :quantity, :size_id
  
  belongs_to :product
  belongs_to :size
  
  validates :product_id, :size_id, :quantity, :presence => true
  validates :quantity, :numericality => { :greater_than_or_equal_to => 0 }
  
  validates_uniqueness_of :product_id, :scope => :size_id
  
  
  # validates :item_number, :presence => true, :uniqueness => true
  # validates :price, :numericality => {:greater_than_or_equal_to => 0.01}
  
end
